//
//  UIView+HUD.swift
//  Shien
//
//  Created by I-Q-I on 2019/4/24.
//  Copyright © 2019 尘埃. All rights reserved.
//
import UIKit
import SVProgressHUD
class Toast{
  static  func toastInfo(_ title: String,_ time: Int? = 1) {
        SVProgressHUD.setBackgroundColor(UIColor.tip)
        SVProgressHUD.setDefaultMaskType(.black)
        SVProgressHUD.showInfo(withStatus: title);
        SVProgressHUD.dismiss(withDelay: TimeInterval(time ?? 1))
    }
    static func toastSuccess(_ title: String,_ time: Int? = 1) {
        SVProgressHUD.setBackgroundColor(UIColor.tip)
        SVProgressHUD.setDefaultMaskType(.black)
        SVProgressHUD.showSuccess(withStatus: title);
        SVProgressHUD.dismiss(withDelay: TimeInterval(time ?? 1))
    }
   static func toastError(_ title: String,_ time: Int? = 1) {
        SVProgressHUD.setBackgroundColor(UIColor.tip)
        SVProgressHUD.setDefaultMaskType(.black)
        SVProgressHUD.showError(withStatus: title);
        SVProgressHUD.dismiss(withDelay: TimeInterval(time ?? 1))
    }
   static func toastWait() {
        SVProgressHUD.setBackgroundColor(UIColor.tip)
        SVProgressHUD.setDefaultMaskType(.black)
        SVProgressHUD.show()
    }
}
